A known motor-driven compressor serving as a fluid machine includes an electric motor and a drive device that drives the electric motor (refer to, for example, Japanese Laid-Open Patent Publication No. 2003-324900). The drive device is coupled to a housing through which fluid is drawn. Heat is exchanged between the fluid and the drive device through the housing to cool the drive device.